fix(server): settle snoozed threads immediately - #5379
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
ApprovabilityVerdict: Approved a5636e3 Straightforward bug fix that extends the settle command to also clear snoozed state, following the existing pattern for clearing pinned state. The change is small, self-contained, and well-tested. You can customize Macroscope's approvability policy. Learn more. |
Settling a snoozed thread persisted the settled override while leaving its snooze active. Because snooze takes precedence in client lifecycle classification, the row stayed in Snoozed until it was woken.
The thread decider now emits
thread.unsnoozedalongsidethread.settledwhenever the thread is snoozed, using the same lifecycle timestamp. This moves the row to Settled immediately, preserves the existing unpin behavior, and lets a repeated settle repair legacy settled-and-snoozed state.Verification:
pnpm exec vp test run apps/server/src/orchestration/decider.settled.test.ts(14 tests)pnpm exec vp test run apps/server/src/orchestration/decider.settled.test.ts apps/server/src/orchestration/decider.snoozed.test.ts(24 tests)pnpm --filter t3 exec tsgo --noEmitgit diff --checkCloses #5377
Made with GPT-5.6 Sol using the Codex harness in T3 Code.
Note
Low Risk
Localized orchestration decider lifecycle behavior with new unit tests; no auth, data migration, or broad API surface changes.
Overview
Settling a thread now clears snooze so the row can show as Settled instead of staying under Snoozed when lifecycle classification prefers snooze over settled.
The
thread.settlehandler indecider.tsbuilds companion events for anything that would keep the row pinned or snoozed: it still emitsthread.unpinnedwhen pinned, and also emitsthread.unsnoozedwith reasonuserwhensnoozedUntilis set. Awake threads still get onlythread.settled. Pinned + snoozed threads get settled, unpinned, and unsnoozed in one command.Tests in
decider.settled.test.tscover snoozed settle, legacy settled-and-still-snoozed repair on repeat settle, and pinned+snoozed combinations.Reviewed by Cursor Bugbot for commit 5a3fd32. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix thread settling to immediately unsnooze snoozed threads
thread.unsnoozed(with reason'user') alongsidethread.settledwhen the thread is snoozed.thread.unpinned; both companion events can now be emitted together in the sequence[thread.settled, ...companions].Macroscope summarized 5a3fd32.